﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
		if (!SystemMan.IsFunctionEnabled(FounctionType.Register))
			feedBack.Text = "系统正在维护中，该页面仅供观赏，注册功能暂时不可用，请稍后再试，谢谢合作！";
		else if (IsPostBack)
		{
			feedBack.CssClass = "hint red";
			if (!SessionMan.ValidateCheckCode(Request.Form["checkCode"]))
			{
				feedBack.Text = "请输入正确的验证码！";
			}
			else if (SE6.UserMan.Register(Request))
			{
				SessionMan.SaveResult(Request.Form["name"]+
					"，您已注册成功，现在可以<a href='login.aspx'>登陆</a>了。");
				Response.Redirect("result.aspx");
			}
			else
			{
				feedBack.CssClass = "hint red";
				feedBack.Text = "注册失败，用户或已存在！";
			}
		}
		else
		{
			feedBack.Text = "请填写注册用户信息";
			feedBack.CssClass = "hint";
		}
		navMenu.InnerHtml = GUI.NavMenu(PageClass.Register);
    }
}
